home *** CD-ROM | disk | FTP | other *** search
- global sSTRINGSTART, sBENDSTRING, gHookPoints, gNumHooks, stringPoints, string2Points, MsetPointIterations, gBASSSTRINGLENBASE, HARP, TIGO, HORN, DRUM, CHIME, BASS, sPALETTE, gObjects, gOBJECTSD, gWorld, gPuppetlines, sQTCharSprite, gNextEnvLetter, gMIDIPlayTRUE, gInitalized, noteObjs, windowsMIDIXObj, xNAVXOBJ, xCURXOBJ, gCPU, gFileSep, gRootPath, gHDpath, gXobjs, gXOBJPath, gCDpath, gCDName
-
- on playChaoticBASS OBJref
- set OBj to getaProp(gObjects, OBJref)
- PlayNoteFromHitMap(#BASS)
- end
-
- on PlayBassNote Pitchnote, Lengthnote
- set note to 65 - ((Pitchnote - 70) / 6)
- if note > 65 then
- set note to 65
- else
- if note < 35 then
- set note to 35
- end if
- end if
- noteOn(#BASS, note, 127)
- if Lengthnote > 120 then
- set Lengthnote to 120
- else
- if Lengthnote < 10 then
- set Lengthnote to 10
- end if
- end if
- set noteOnTime to the ticks
- repeat while the ticks < (noteOnTime + Lengthnote)
- CursorandUpdate()
- end repeat
- noteOff(#BASS, note)
- end
-
- on CheckStringClick H, V, Slopelist
- set C to count(Slopelist)
- repeat with X = 1 to C
- set aLine to getaProp(getaProp(getaProp(gObjects, getAt(Slopelist, X)), #SpriteProp), #rect)
- if inside(point(H, V), aLine) then
- ONslope(point(H, V), aLine)
- end if
- if ONslope(point(H, V), aLine) then
- set StringNum to getAt(Slopelist, X)
- return StringNum
- end if
- end repeat
- end
-
- on CalSlope x1, y1, x2, y2
- set SUB to abs(x1 - x2)
- if SUB <> 0 then
- return integer(abs(y1 - y2) / float(SUB))
- else
- return 0
- end if
- end
-
- on ONslope aPoint, aLine
- set orginPointX to the left of aLine
- set orginPointY to the top of aLine
- set Lineslope to CalSlope(orginPointX, orginPointY, the right of aLine, the bottom of aLine)
- if Lineslope = 0 then
- return 0
- else
- set PointSlope to CalSlope(orginPointX, orginPointY, the locH of aPoint, the locV of aPoint)
- if Lineslope = PointSlope then
- return 1
- end if
- end if
- end
-
- on UnHookBass Stringref, HookNum
- set OBj to getaProp(gObjects, Stringref)
- set hookpoint to getAt(getaProp(getaProp(gObjects, #BASS), #HookPoints), HookNum)
- setAt(getaProp(getaProp(gObjects, #BASS), #Hooked), HookNum, 0)
- MakeDynamic(#BASS, #Hooked, getaProp(getaProp(gObjects, #BASS), #Hooked))
- bassString(Stringref, the locH of hookpoint, the locV of hookpoint)
- end
-
- on bassString OBJref, mH, mV
- set BASSObj to getaProp(gObjects, #BASS)
- set OBj to getaProp(gObjects, OBJref)
- set Fake to getaProp(gObjects, getaProp(OBj, #Attach))
- set OBJSprite to getaProp(OBj, #SpriteNum)
- set FakeSprite to getaProp(Fake, #SpriteNum)
- set ObjL to the left of sprite getaProp(OBj, #SpriteNum)
- set ObjT to the top of sprite getaProp(OBj, #SpriteNum)
- set FakeR to the right of sprite getaProp(Fake, #SpriteNum)
- set FakeB to the bottom of sprite getaProp(Fake, #SpriteNum)
- repeat while the mouseDown
- UpdateBassStrings(OBj, OBJSprite, ObjL, ObjT, mH, mV)
- UpdateBassStrings(Fake, FakeSprite, mH, mV, FakeR, FakeB)
- CursorandUpdate()
- set mH to the mouseH
- set mV to the mouseV
- end repeat
- set Hook to CheckinHookRect(mH, mV)
- if Hook <> #false then
- if getAt(getaProp(BASSObj, #Hooked), Hook) = 0 then
- setAt(getaProp(BASSObj, #Hooked), Hook, OBJref)
- set aPoint to getAt(getaProp(BASSObj, #HookPoints), Hook)
- set newH to the locH of aPoint
- set newV to the locV of aPoint
- UpdateBassStrings(OBj, OBJSprite, ObjL, ObjT, newH, newV)
- UpdateBassStrings(Fake, FakeSprite, newH, newV, FakeR, FakeB)
- CursorandUpdate()
- else
- set Hook to #false
- end if
- end if
- if Hook = #false then
- UpdateBassStrings(OBj, OBJSprite, ObjL, ObjT, FakeR + 3, FakeB)
- UpdateBassStrings(Fake, FakeSprite, FakeR + 3, FakeB, FakeR, FakeB)
- CursorandUpdate()
- end if
- DynamicLOCRECT(OBJref)
- DynamicLOCRECT(getaProp(OBj, #Attach))
- end
-
- on UpdateBassStrings OBj, Snum, left, top, right, bottom
- set lean to FindLean(left, top, right, bottom)
- setaProp(OBj, #DisplayState, lean)
- set the castNum of sprite Snum to getaProp(getaProp(OBj, #cast), getaProp(OBj, #DisplayState))
- set the rect of sprite Snum to rect(left, top, right, bottom)
- end
-
- on FindLean left, top, right, bottom
- if top > bottom then
- if left > right then
- return #right
- else
- return #left
- end if
- else
- if left > right then
- return #left
- else
- return #right
- end if
- end if
- end
-
- on constrainNote note
- if note > 100 then
- set note to (note / 10) + 30
- end if
- if note < 30 then
- set note to note + 30
- end if
- if note > 60 then
- set note to note - 30
- end if
- return note
- end
-
- on CheckhookRect NUM
- set Hookref to getAt(getaProp(getaProp(gObjects, #BASS), #Hooked), NUM)
- if Hookref <> 0 then
- return Hookref
- else
- return #false
- end if
- end
-
- on CheckinHookRect H, V
- set C to count(getaProp(getaProp(gObjects, #BASS), #Hookrects))
- repeat with NUM = 1 to C
- if inside(point(H, V), getAt(getaProp(getaProp(gObjects, #BASS), #Hookrects), NUM)) then
- return NUM
- end if
- end repeat
- return #false
- end
-
- on DoCheckLinePull OBJref
- set H to the mouseH
- set V to the mouseV
- set HookedNum to CheckinHookRect(H, V)
- if HookedNum <> #false then
- set Hookedlines to CheckhookRect(HookedNum)
- if Hookedlines <> #false then
- UnhookLineMove(Hookedlines, HookedNum)
- end if
- else
- set index to xCURXOBJ(mWhere, H, V)
- if index > 0 then
- MoveHookedLine(index)
- end if
- end if
- end
-
- on CheckBassStringUP Snum, LineRef, H, V
- set HookedNum to CheckinHookRect(H, V)
- if HookedNum <> #false then
- if CheckhookRect(HookedNum) = #false then
- ShowNewHookedLines(HookedNum, LineRef)
- CheckBassChaotic()
- else
- ResetBassLineStart(Snum, H, V)
- end if
- else
- ResetBassLineStart(Snum, H, V)
- end if
- end
-
- on CheckBassChaotic
- set Chaotic to 1
- repeat with Snum in [5, 8, 9, 14, 16, 21]
- if the visible of sprite Snum = 1 then
- next repeat
- next repeat
- end if
- set Chaotic to 0
- exit repeat
- end repeat
- if Chaotic = 1 then
- set BaseAnim to getaProp(gObjects, #BassToChaos)
- playSound("D12strn.aif", #keyframeCast)
- set the loc of sprite getaProp(BaseAnim, #SpriteNum) to getaProp(BaseAnim, #loc)
- repeat with CastID in getaProp(getaProp(BaseAnim, #cast), #FrameData)
- set the castNum of sprite getaProp(BaseAnim, #SpriteNum) to CastID
- CursorandUpdate()
- end repeat
- UnLoadChoaticHitMap()
- LoadChoaticHitMap(#BASS)
- ChangeSpecialState(#BASS, #Chaotic)
- end if
- end
-
- on MoveHookedLine index
- set lineclicked to getAt(getaProp(getaProp(getaProp(gObjects, #BASS), #SpecialChild), #nonChaotic), index)
- set ClickOBJ to getaProp(gObjects, lineclicked)
- set Snum to getaProp(ClickOBJ, #SpriteNum)
- if the visible of sprite Snum = 1 then
- set aTop to the top of sprite Snum
- set aBottom to the bottom of sprite Snum
- if the type of sprite Snum = 5 then
- set aleft to the left of sprite Snum
- set aRight to the right of sprite Snum
- else
- set aleft to the right of sprite Snum
- set aRight to the left of sprite Snum
- end if
- set the visible of sprite Snum to 0
- set returnLoc to LineMove(aleft, aTop, aRight, aBottom)
- CheckBassStringUP(Snum, lineclicked, the locH of returnLoc, the locV of returnLoc)
- end if
- end
-
- on LineMove aleft, aTop, aRight, aBottom
- set Fake1 to getaProp(gObjects, #BasslineFake1)
- set Fake1Snum to getaProp(Fake1, #SpriteNum)
- set Fake2 to getaProp(gObjects, #BasslineFake2)
- set Fake2Snum to getaProp(Fake2, #SpriteNum)
- repeat while the mouseDown
- set H to the mouseH
- set V to the mouseV
- UpdateBassStrings(Fake1, Fake1Snum, aleft, aTop, H, V)
- UpdateBassStrings(Fake2, Fake2Snum, H, V, aRight, aBottom)
- updateStage()
- end repeat
- return point(H, V)
- end
-
- on ValidLine line1, HookedNum
- set aLine to value("#" & "Bassline" & line1 & HookedNum)
- if voidp(getaProp(gObjects, aLine)) then
- set aLine to value("#" & "Bassline" & HookedNum & line1)
- end if
- return aLine
- end
-
- on UnhookLineMove Hookedlines, HookedNum
- set Hookedlines to []
- repeat with Link in [#BL, #BR, #T, 1, 2, 3, 4]
- if Link <> HookedNum then
- set TryLine to ValidLine(Link, HookedNum)
- if the visible of sprite getaProp(getaProp(gObjects, TryLine), #SpriteNum) = 1 then
- add(Hookedlines, TryLine)
- end if
- end if
- end repeat
- set Line1OBj to getaProp(gObjects, getAt(Hookedlines, 1))
- set Line2OBj to getaProp(gObjects, getAt(Hookedlines, 2))
- set S1 to getaProp(Line1OBj, #SpriteNum)
- set S2 to getaProp(Line2OBj, #SpriteNum)
- setAt(getaProp(getaProp(gObjects, #BASS), #Hooked), HookedNum, 0)
- setaProp(getaProp(Line1OBj, #SpriteProp), #visible, 0)
- setaProp(getaProp(Line2OBj, #SpriteProp), #visible, 0)
- MakeDynamic(getAt(Hookedlines, 1), #State, #INVisible)
- MakeDynamic(getAt(Hookedlines, 2), #State, #INVisible)
- set line1char1 to char 9 of string(getAt(Hookedlines, 1))
- set line1char2 to char 10 of string(getAt(Hookedlines, 1))
- if line1char2 = "B" then
- set line1char2 to char 10 to 11 of string(getAt(Hookedlines, 1))
- end if
- if line1char1 <> string(HookedNum) then
- set line1 to line1char1
- else
- set line1 to line1char2
- end if
- set line2char1 to char 9 of string(getAt(Hookedlines, 2))
- set line2char2 to char 10 of string(getAt(Hookedlines, 2))
- if line2char2 = "B" then
- set line2char2 to char 10 to 11 of string(getAt(Hookedlines, 2))
- end if
- if line2char1 <> string(HookedNum) then
- set line2 to line2char1
- else
- set line2 to line2char2
- end if
- set EndlineRef to ValidLine(line1, line2)
- set Snum to getaProp(getaProp(gObjects, EndlineRef), #SpriteNum)
- set the visible of sprite S1 to 0
- set the visible of sprite S2 to 0
- set aTop to the top of sprite Snum
- set aBottom to the bottom of sprite Snum
- if the type of sprite Snum = 5 then
- set aleft to the left of sprite Snum
- set aRight to the right of sprite Snum
- else
- set aleft to the right of sprite Snum
- set aRight to the left of sprite Snum
- end if
- set returnLoc to LineMove(aleft, aTop, aRight, aBottom)
- CheckBassStringUP(Snum, EndlineRef, the locH of returnLoc, the locV of returnLoc)
- end
-
- on ShowNewHookedLines HookedNum, lineclicked
- set line1 to char 9 of string(lineclicked)
- set line2 to char 10 of string(lineclicked)
- if line2 = "B" then
- set line2 to char 10 to 11 of string(lineclicked)
- end if
- set line1name to ValidLine(line1, HookedNum)
- set line2name to ValidLine(line2, HookedNum)
- set Line1OBj to getaProp(gObjects, line1name)
- set Line2OBj to getaProp(gObjects, line2name)
- set the visible of sprite getaProp(Line1OBj, #SpriteNum) to 1
- set the visible of sprite getaProp(Line2OBj, #SpriteNum) to 1
- set the rect of sprite getaProp(getaProp(gObjects, #BasslineFake1), #SpriteNum) to rect(-2000, -2000, -2000, -2000)
- set the rect of sprite getaProp(getaProp(gObjects, #BasslineFake2), #SpriteNum) to rect(-2000, -2000, -2000, -2000)
- setaProp(getaProp(Line1OBj, #SpriteProp), #visible, 1)
- setaProp(getaProp(Line2OBj, #SpriteProp), #visible, 1)
- MakeDynamic(line1name, #State, #visible)
- MakeDynamic(line2name, #State, #visible)
- setAt(getaProp(getaProp(gObjects, #BASS), #Hooked), HookedNum, [line1name, line2name])
- end
-
- on ResetBassLineStart Snum, H, V
- set the rect of sprite getaProp(getaProp(gObjects, #BasslineFake1), #SpriteNum) to rect(-2000, -2000, -2000, -2000)
- set the rect of sprite getaProp(getaProp(gObjects, #BasslineFake2), #SpriteNum) to rect(-2000, -2000, -2000, -2000)
- set the visible of sprite Snum to 1
- CursorandUpdate()
- set one to abs(the bottom of sprite Snum - the top of sprite Snum)
- set Two to abs(the right of sprite Snum - the left of sprite Snum)
- set Dis to max(list(one, Two))
- set locPoint to point(H, V)
- set HPoint to point(the right of sprite Snum, the bottom of sprite Snum) - locPoint
- set Vpoint to point(the left of sprite Snum, the top of sprite Snum) - locPoint
- set resultpoint to HPoint - Vpoint
- set leng to max(list(the locV of resultpoint, the locH of resultpoint))
- PlayBassNote(Dis, leng)
- end
-